import { fromJS } from 'immutable';
import * as constants from './constants';

const defaultState = fromJS({
	loginstatus: false
});

export default function LoginReducer(state = defaultState, action) 
{
	const {value,type}=action
	switch(type) {
		case constants.CHANGE_LOGIN:
			return state.set('loginstatus',value);
		case constants.LOGOUT:
			return state.set('loginstatus', value);
		default:
			return state;
	}
}